Skip to content

perf(@ngtools/webpack): reduce redundant module rebuilds when cache is restored#22377

Merged
dgp1130 merged 1 commit intoangular:masterfrom
alan-agius4:perf-fs-cache-rebuild-ngtools
Dec 15, 2021
Merged

perf(@ngtools/webpack): reduce redundant module rebuilds when cache is restored#22377
dgp1130 merged 1 commit intoangular:masterfrom
alan-agius4:perf-fs-cache-rebuild-ngtools

Conversation

@alan-agius4
Copy link
Copy Markdown
Collaborator

With this change we reduce the redundant module rebuilds when Webpack's FS cache is restored.

Previously, when the cache was restored we caused all modules to be rebuild even though their contents didn't change. This is because the file emit history wasn't persisted to disk.

This also caused the side effect that Webpack will create additional cache pack files due to the unnecessary module rebuilds, which ultimately causes increase of the size of the cache on disk.

Partially addresses #22323 (comment)

… restored

With this change we reduce the redundant module rebuilds when Webpack's FS cache is restored.

Previously, when the cache was restored we caused all modules to be rebuild even though their contents didn't change. This is because the file emit history wasn't persisted to disk.

This also caused the side effect that Webpack will create additional cache `pack` files due to the unnecessary module rebuilds, which ultimatly causes increase of the size of the cache on disk.
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Dec 15, 2021
@alan-agius4 alan-agius4 requested a review from dgp1130 December 15, 2021 13:44
@alan-agius4
Copy link
Copy Markdown
Collaborator Author

alan-agius4 commented Dec 15, 2021

From initial benchmarks it also shows a ~600ms reduction for warm build times on ng new apps.

@dgp1130 dgp1130 added the action: merge The PR is ready for merge by the caretaker label Dec 15, 2021
@dgp1130 dgp1130 merged commit b03b9ee into angular:master Dec 15, 2021
@alan-agius4 alan-agius4 deleted the perf-fs-cache-rebuild-ngtools branch December 15, 2021 19:42
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants